package com.example.iotest.bio;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class MyClient1 {
    private static String name = "Tom";

    public static void main(String[] args) throws IOException {
        sendMessage();
    }

    public static void sendMessage() throws IOException {
        Socket socket = new Socket("192.168.1.28", 8000);
        OutputStream outputStream = socket.getOutputStream();
        byte[] buffer = new byte[10];
        buffer = name.getBytes();
        outputStream.write(buffer);
        outputStream.write("hello world".getBytes());
        outputStream.close();
    }
}
